﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Infinity.Expressions.Core;

namespace Infinity.Expressions.Commands
{
	public partial class BlockCommand : ICollection<AbstractProgram>
	{
		protected List<AbstractProgram> subPrograms { get; set; }

		public void Add(AbstractProgram item)
		{
			subPrograms.Add(item);
		}

		public void Clear()
		{
			subPrograms.Clear();
		}

		public bool Contains(AbstractProgram item)
		{
			return subPrograms.Contains(item);
		}

		public void CopyTo(AbstractProgram[] array, int arrayIndex)
		{
			subPrograms.CopyTo(array, arrayIndex);
		}

		public int Count
		{
			get { return subPrograms.Count; }
		}

		public bool IsReadOnly
		{
			get { return false; }
		}

		public bool Remove(AbstractProgram item)
		{
			return subPrograms.Remove(item);
		}

		public IEnumerator<AbstractProgram> GetEnumerator()
		{
			return subPrograms.GetEnumerator();
		}

		System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
		{
			return subPrograms.GetEnumerator();
		}
	}
}
